#include "../source/server.hpp"

int main(int argc, char *argv[])
{
    std::string ip = argv[1];
    uint16_t port = std::stoi(argv[2]);
    Socket *sock = new Socket;
    sock->CreateClient(port, ip);
    //每一秒发送一次数据
    for (int i = 0; i < 5; i++)
    {
        std::string str = "hello";
        ssize_t n = sock->Send(str.c_str(), str.size());
        char buffer[1024];
        sock->Recv(buffer, 1023);
        std::cout << buffer << std::endl;
        sleep(1);
    }
    while(1)
    {
        sleep(1);
    }
    return 0;
}